home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1443 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: ecmwf.int!munin!mab
  2. From: mab@ecmwf.co.uk (Baudouin Raoult)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: locking
  5. Date: 11 Jan 1996 00:12:18 GMT
  6. Organization: European Centre for Medium Range Weather Forecasts
  7. Distribution: world
  8. Message-ID: <4d1kl2$64c@daphne.ecmwf.int>
  9. References: <4d0j6r$1ri@daphne.ecmwf.int> <ENNO.96Jan10223330@kitz.inferenzsysteme.informatik.th-darmstadt.de>
  10. NNTP-Posting-Host: munin.ecmwf.int
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. [stuff deleted]
  14.  
  15. : For the class
  16.  
  17. :     struct Foo { void bar(); }
  18.  
  19. : a method-invocation like: 
  20.  
  21. :     Foo f;
  22. :     SharedObject<Foo> s(&f);
  23. :     s->bar(); // (1)
  24.  
  25. : results in 
  26. :         
  27. :       ((s.operator->()).operator->())->bar(); // = (1)
  28.  
  29. : IMHO, the 'LockObject' temporary created in this expression should be
  30. : destroyed after this line. To force this behavior from an unwilling
  31. : compiler (;-) one can put (1) in brackets. So the brackets are used to
  32. : restrict the lifetime of the temporary and not the one of the SharedObject
  33. : instance.
  34.  
  35. :     Enno
  36.  
  37. Thanks for showing some nterest to my original posting. I was
  38. trying to establish a way to wrap/lock any object and them forget about
  39. it. So the { } are not a satisfactory. It looks like my  compiler
  40. (cfront 3.??) is not right.
  41.  
  42. Baudouin
  43. --
  44.  
  45. ---------------------------------------------------
  46. Baudouin Raoult. 
  47. European Center for Medium Range Weather Forecast
  48. Reading, UK
  49. ---------------------------------------------------
  50.